home *** CD-ROM | disk | FTP | other *** search
/ Belgian Amiga Club - ADF Collection / BS1 part 41.zip / BS1 part 41 / Devpac 2.12 disk 2.adf / include.cbm / libraries / dos.i < prev    next >
Text File  |  1987-03-31  |  6KB  |  156 lines

  1. * Standard assembler header for Amiga DOS on the MC68000   
  2.  
  3.    IFND LIBRARIES_DOS_I
  4. LIBRARIES_DOS_I            SET      1
  5.  
  6. *      IFND EXEC_TYPES_I
  7. *      INCLUDE "exec/types.i"
  8. *      ENDC
  9.  
  10.  
  11. DOSNAME     MACRO
  12.       DC.B  'dos.library',0
  13.       ENDM
  14.  
  15. * Predefined Amiga DOS global constants 
  16.  
  17. * Mode parameter to Open() 
  18. MODE_OLDFILE         EQU   1005   * Open existing file read/write 
  19. *                                 * positioned at beginning of file. 
  20. MODE_NEWFILE         EQU   1006   * Open freshly created file (delete 
  21. *                                 * old file) read/write            
  22.  
  23. * Relative position to Seek() 
  24. OFFSET_BEGINNING     EQU   -1     * relative to Beginning Of File 
  25. OFFSET_CURRENT       EQU    0     * relative to Current file position 
  26. OFFSET_END           EQU    1     * relative to End Of File    
  27.  
  28. OFFSET_BEGINING     EQU   OFFSET_BEGINNING     * Ancient compatibility
  29.  
  30. BITSPERBYTE          EQU   8
  31. BYTESPERLONG         EQU   4
  32. BITSPERLONG          EQU   32
  33. MAXINT               EQU   $7FFFFFFF
  34. MININT               EQU   $80000000
  35.  
  36. * Passed as type to Lock() 
  37. SHARED_LOCK          EQU   -2   ; File is readable by others 
  38. ACCESS_READ          EQU   -2   ; Synonym
  39. EXCLUSIVE_LOCK       EQU   -1   ; No other access allowed    
  40. ACCESS_WRITE         EQU   -1   ; Synonym
  41.  
  42.  
  43.  STRUCTURE DateStamp,0 
  44.    LONG  ds_Days                ; Number of days since Jan. 1, 1978
  45.    LONG  ds_Minute              ; Number of minutes past midnight 
  46.    LONG  ds_Tick                ; Number of ticks past minute 
  47.    LABEL ds_SIZEOF              ; DateStamp 
  48. TICKS_PER_SECOND EQU 50         ; Number of ticks in one second 
  49.  
  50. * Returned by Examine() and ExInfo() 
  51.  STRUCTURE FileInfoBlock,0
  52.    LONG   fib_DiskKey
  53.    LONG   fib_DirEntryType      ; Type of Directory. If < 0, then a plain file.
  54.                                 ; If > 0 a directory 
  55.    STRUCT fib_FileName,108      ; Null terminated. Max 30 chars used for now 
  56.    LONG   fib_Protection        ; bit mask of protection, rwxd are 3-0.      
  57.    LONG   fib_EntryType
  58.    LONG   fib_Size              ; Number of bytes in file 
  59.    LONG   fib_NumBlocks         ; Number of blocks in file 
  60.    STRUCT fib_DateStamp,ds_SIZEOF ; Date file last changed.
  61.    STRUCT fib_Comment,116       ; Null terminated. Comment associated with file 
  62.    LABEL  fib_SIZEOF            ; FileInfoBlock 
  63.  
  64. * FIB stands for FileInfoBlock 
  65. * FIBB are bit definitions, FIBF are field definitions 
  66.    BITDEF   FIB,ARCHIVE,4       ; cleared whenever file is changed
  67.    BITDEF   FIB,READ,3          ; ignored by the system
  68.    BITDEF   FIB,WRITE,2         ; ignored by the system
  69.    BITDEF   FIB,EXECUTE,1       ; ignored by the system
  70.    BITDEF   FIB,DELETE,0        ; prevent file from being deleted
  71.  
  72.  
  73. * All BCPL data must be long word aligned.  BCPL pointers are the long word
  74. * address (i.e byte address divided by 4 (>>2))
  75.  
  76. * Macro to indicate BCPL pointers
  77. BPTR     MACRO                      * Long word pointer
  78.          LONG     \1
  79.          ENDM
  80. BSTR     MACRO                      * Long word pointer to BCPL string.
  81.          LONG     \1
  82.          ENDM
  83.  
  84. * #define BADDR( bptr ) (bptr << 2) * Convert BPTR to byte addressed pointer
  85.  
  86. * BCPL strings have a length in the first byte and then the characters.
  87. * For example:  s[0]=3 s[1]=S s[2]=Y s[3]=S
  88.  
  89. * returned by Info() 
  90.  STRUCTURE InfoData,0
  91.    LONG id_NumSoftErrors        * number of soft errors on disk 
  92.    LONG id_UnitNumber           * Which unit disk is (was) mounted on 
  93.    LONG id_DiskState            * See defines below 
  94.    LONG id_NumBlocks            * Number of blocks on disk 
  95.    LONG id_NumBlocksUsed        * Number of block in use 
  96.    LONG id_BytesPerBlock   
  97.    LONG id_DiskType             * Disk Type code
  98.    BPTR id_VolumeNode           * BCPL pointer to volume node
  99.    LONG id_InUse                * Flag, zero if not in use
  100.    LABEL id_SIZEOF              * InfoData 
  101.  
  102. * ID stands for InfoData 
  103. *            Disk states
  104. ID_WRITE_PROTECTED      EQU     80      * Disk is write protected 
  105. ID_VALIDATING           EQU     81      * Disk is currently being validated 
  106. ID_VALIDATED            EQU     82      * Disk is consistent and writeable 
  107. *          Disk types 
  108. ID_NO_DISK_PRESENT      EQU -1
  109. ID_UNREADABLE_DISK      EQU  ('B'<<24)!('A'<<16)!('D'<<8)
  110. ID_NOT_REALLY_DOS       EQU  ('N'<<24)!('D'<<16)!('O'<<8)!('S')
  111. ID_DOS_DISK             EQU  ('D'<<24)!('O'<<16)!('S'<<8)
  112. ID_KICKSTART_DISK       EQU  ('K'<<24)!('I'<<16)!('C'<<8)!('K')
  113.  
  114. * Errors from IoErr(), etc. 
  115. ERROR_NO_FREE_STORE               EQU  103
  116. ERROR_TASK_TABLE_FULL             EQU  105
  117. ERROR_LINE_TOO_LONG               EQU  120
  118. ERROR_FILE_NOT_OBJECT             EQU  121
  119. ERROR_INVALID_RESIDENT_LIBRARY    EQU  122
  120. ERROR_OBJECT_IN_USE               EQU  202
  121. ERROR_OBJECT_EXISTS               EQU  203
  122. ERROR_OBJECT_NOT_FOUND            EQU  205
  123. ERROR_ACTION_NOT_KNOWN            EQU  209
  124. ERROR_INVALID_COMPONENT_NAME      EQU  210
  125. ERROR_INVALID_LOCK                EQU  211
  126. ERROR_OBJECT_WRONG_TYPE           EQU  212
  127. ERROR_DISK_NOT_VALIDATED          EQU  213
  128. ERROR_DISK_WRITE_PROTECTED        EQU  214
  129. ERROR_RENAME_ACROSS_DEVICES       EQU  215
  130. ERROR_DIRECTORY_NOT_EMPTY         EQU  216
  131. ERROR_DEVICE_NOT_MOUNTED          EQU  218
  132. ERROR_SEEK_ERROR                  EQU  219
  133. ERROR_COMMENT_TOO_BIG             EQU  220   
  134. ERROR_DISK_FULL                   EQU  221
  135. ERROR_DELETE_PROTECTED            EQU  222
  136. ERROR_WRITE_PROTECTED             EQU  223 
  137. ERROR_READ_PROTECTED              EQU  224
  138. ERROR_NOT_A_DOS_DISK              EQU  225
  139. ERROR_NO_DISK                     EQU  226
  140. ERROR_NO_MORE_ENTRIES             EQU  232
  141.  
  142. * These are the return codes used by convention by AmigaDOS commands 
  143. * See FAILAT and IF for relvance to EXECUTE files                    
  144. RETURN_OK                         EQU    0  * No problems, success 
  145. RETURN_WARN                       EQU    5  * A warning only 
  146. RETURN_ERROR                      EQU   10  * Something wrong 
  147. RETURN_FAIL                       EQU   20  * Complete or severe failure
  148.  
  149. * Bit numbers that signal you that a user has issued a break
  150.         BITDEF  SIGBREAK,CTRL_C,12
  151.         BITDEF  SIGBREAK,CTRL_D,13
  152.         BITDEF  SIGBREAK,CTRL_E,14
  153.         BITDEF  SIGBREAK,CTRL_F,15
  154.  
  155.    ENDC LIBRARIES_DOS_I
  156.